<%@page contentType="text/html;charset=utf-8" pageEncoding="UTF-8" %>
<%@page import="org.ipo.mm.web.util.pager.MeetingPager, java.util.Collection, org.ipo.mm.web.util.security.SecurityManager" %>
<%@page  language="java"
         import="org.ipo.mm.web.util.*, java.util.ArrayList"%>
<%@taglib prefix="h" uri="http://struts.apache.org/tags-html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="b" uri="http://struts.apache.org/tags-bean"%>

<%Collection<Integer> privileges = (Collection<Integer>) request.getSession().getAttribute(ConstantManager.SESSION_USER_PRIVILEGES);%>



<div id="treemenu">
    <div onclick="layout.close('west');$.cookie('hideWest', 'true');" style="text-align: right; border-bottom: 1px solid rgb(187, 187, 187); cursor: pointer;"> << </div>
    <ul id="horizontalmenu" class="example_menu">
        <li><a class="collapsed"><b:message key="menu_search_list"/></a>
            <ul>
                <li>
                    <h:link action="/protected/meeting_search.do?method=showMeetings&clearStack=true&readOnly=true">
                        <b:message key="meetings_show_read_mode"/>
                    </h:link>
                </li>
                <li><h:link action="/protected/representative_search.do?method=showReprs&clearStack=true&readOnly=true">
                        <b:message key="representatives_show_read_mode"/>
                    </h:link>
                </li>
                <li>
                    <h:link action="/protected/institution_search?method=showInstitutions&clearStack=true&readOnly=true">
                        <b:message key="institutions_show_read_mode" /></h:link>
                    </li>
                    <li>
                    <h:link action="/protected/dispatch?method=showFamilies&clearStack=true&readOnly=true"><b:message key="families_show_read_mode" /></h:link>
                </li>
                <li>
                    <h:link action="/protected/dispatch?method=showTypes&clearStack=true&readOnly=true"><b:message key="types_show_read_mode" /></h:link>
                </li>
                <li>
                    <% if (privileges.contains(SecurityManager.READ_IREGION_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showRegions&clearStack=true&readOnly=true">
                        <b:message key="regions_show_read_mode"/>
                    </h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="regions_show_read_mode"/>
                    </a>
                    <%}%>
                </li>
                <li>
                    <h:link action="/protected/dispatch?method=showCities&clearStack=true&readOnly=true">
                        <b:message key="cities_show_read_mode" />
                    </h:link>
                </li>
            </ul>
        </li>
        <li class="footer"><span> </span></li>
        <li><a class="collapsed"><b:message key="menu_edit_list"/></a>
            <ul>
                <li>
                    <%if (privileges.contains(SecurityManager.EDIT_MEETING_PRIVILEGE)) {%>
                    <h:link action="/protected/meeting_search.do?method=showMeetings&clearStack=true&readOnly=false">
                        <b:message key="meetings_show_edit_mode"/>
                    </h:link>
                    <%} else {%>
                    <a href="#" onclick='forbiden(); return false;' class="disabled">
                        <b:message key="meetings_show_edit_mode"/></a>
                        <%}%>
                </li>
                <li>
                    <%if (privileges.contains(SecurityManager.EDIT_REPRESENTATIVE_PRIVILEGE)) {%>
                    <h:link action="/protected/representative_search.do?method=showReprs&clearStack=true&readOnly=false">
                        <b:message key="representatives_show_edit_mode"/>
                    </h:link>

                    <%} else {%>
                    <a href="#" onclick='forbiden(); return false;' class="disabled">
                        <b:message key="representatives_show_edit_mode"/></a>
                        <%}%>
                </li>
                <li>
                    <%if (privileges.contains(SecurityManager.EDIT_INSTITUTION_PRIVILEGE)) {%>
                    <h:link action="/protected/institution_search?method=showInstitutions&clearStack=true&readOnly=false">
                        <b:message key="institutions_show_edit_mode" /></h:link>
                    <%} else {%>
                    <a href="#" onclick='forbiden(); return false;' class="disabled">
                        <b:message key="institutions_show_edit_mode"/></a>
                        <%}%>
                </li>
                <li>
                    <%if (privileges.contains(SecurityManager.EDIT_IFAMILY_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showFamilies&clearStack=true&readOnly=false"><b:message key="families_show_edit_mode" /></h:link>
                    <%} else {%>
                    <a href="#" onclick='forbiden(); return false;' class="disabled">
                        <b:message key="families_show_edit_mode"/></a>
                        <%}%>
                </li>
                <li>
                    <%
                                if (privileges.contains(SecurityManager.EDIT_ITYPE_PRIVILEGE)) {
                    %>
                    <h:link action="/protected/dispatch?method=showTypes&clearStack=true&readOnly=false"><b:message key="types_show_edit_mode" /></h:link>    <% } else {%>
                    <a href="#" onclick='forbiden(); return false;' class="disabled">
                        <b:message key="types_show_edit_mode"/></a>
                        <%}%>
                </li>
                <li>
                    <% if (privileges.contains(SecurityManager.EDIT_IREGION_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showRegions&clearStack=true&readOnly=false">
                        <b:message key="regions_show_edit_mode" />
                    </h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="regions_show_edit_mode"/>
                    </a>
                    <%}%>
                </li>
                <li>
                    <%if (privileges.contains(SecurityManager.EDIT_CITY_PRIVILEGE)) {%>

                    <h:link action="/protected/dispatch?method=showCities&clearStack=true&readOnly=false">
                        <b:message key="cities_show_edit_mode" /></h:link>

                    <%} else {%>

                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="cities_show_edit_mode" /></a>

                    <%}%>
                </li>
            </ul>
        </li>
        <li class="footer"><span> </span></li>
        <li><a class="collapsed"><b:message key="menu_create"/></a>
            <ul>
                <li>
                    <%if (privileges.contains(SecurityManager.CREATE_MEETING_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showCreateMeetingForm&clearStack=true">
                        <b:message key="meetings_createnew"/>
                    </h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="meetings_createnew"/></a>
                        <%}%>
                </li>
                <li>
                    <%if (privileges.contains(SecurityManager.CREATE_REPRESENTATIVE_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch.do?method=showCreateReprForm&clearStack=true">
                        <b:message key="repr_create"/>
                    </h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="repr_create"/></a>
                        <%}%>
                </li>
                <li>
                    <%if (privileges.contains(SecurityManager.CREATE_INSTITUTION_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showCreateInstForm&clearStack=true"><b:message key="inst_create"/></h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="inst_create"/></a>
                        <%}%>
                </li>
                <li>


                    <% if (privileges.contains(SecurityManager.CREATE_IFAMILY_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showCreateFamilyForm&clearStack=true">
                        <b:message key="families_create"/></h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="families_create"/></a>
                        <%}%>
                </li>
                <li>

                    <% if (privileges.contains(SecurityManager.CREATE_ITYPE_PRIVILEGE)) {%>

                    <h:link action="/protected/dispatch?method=showCreateTypeForm&clearStack=true"><b:message key="types_create"/></h:link>

                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="types_create"/></a>

                    <%}%>
                </li>
                <li>

                    <% if (privileges.contains(SecurityManager.CREATE_IREGION_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showCreateRegionForm&clearStack=true"><b:message key="regions_create"/></h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="regions_create"/></a>
                        <%}%>
                </li>
                <li>
                    <%if (privileges.contains(SecurityManager.CREATE_CITY_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showCreateCityForm&clearStack=true"><b:message key="cities_create"/></h:link>

                    <%} else {%>

                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="cities_create"/></a>

                    <%}%>
                </li>
            </ul>
        </li>
        <li class="footer"><span> </span></li>
        <li><a class="collapsed"><b:message key="menu_send"/></a>
            <ul>
                <li>


                    <%if (privileges.contains(SecurityManager.SEND_BULK_MAIL_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showSendMail&clearStack=true"><b:message key="menu_representatives_mails"/></h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="menu_representatives_mails"/></a>
                        <%}%>
                </li>
                <li>
                    <%if (privileges.contains(SecurityManager.PRINT_MAIL_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showPrintPostMail&clearStack=true"><b:message key="menu_representatives_envelopes"/></h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="menu_representatives_envelopes"/></a>
                        <%}%>
                </li>
                <li>

                    <h:link action="/protected/dispatch?method=showPrintPostMailInst&clearStack=true"><b:message key="menu_institutions_envelopes"/></h:link>

                </li>
                <li>
                    <h:link action="/protected/dispatch?method=showSendMailInstitution&clearStack=true"><b:message key="menu_institutions_mails"/></h:link>
                </li>
            </ul>
        </li>
        <li class="footer"><span> </span></li>
        <li><a class="collapsed"><b:message key="menu_reports"/></a>
            <ul>
                <li>
                    <%if (privileges.contains(SecurityManager.DISPLAY_REPORTS_MENU_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showReportsMenu&tabId=0&clearStack=true"><b:message key="reports_group_inst"/></h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="reports_group_inst"/></a>
                        <%}%>
                </li>

                <li>
                    <%if (privileges.contains(SecurityManager.DISPLAY_REPORTS_MENU_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showReportsMenu&tabId=1&clearStack=true"><b:message key="reports_group_meetings"/></h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="reports_group_meetings"/></a>
                        <%}%>
                </li>	<li>
                    <%if (privileges.contains(SecurityManager.DISPLAY_REPORTS_MENU_PRIVILEGE)) {%>
                    <h:link action="/protected/dispatch?method=showReportsMenu&tabId=2&clearStack=true"><b:message key="reports_group_repr"/></h:link>
                    <%} else {%>
                    <a href="#" onclick="forbiden(); return false;" class="disabled">
                        <b:message key="reports_group_repr"/></a>
                        <%}%>
                </li></ul>
        </li>
        <li class="footer"><span> </span></li>
    </ul>
</div>



